/******************************************************************************
    File    :   CaroBoard.cs
    Version :   1.0.0.0
 	Date    :	16/10/2008   14:04
-------------------------------------------------------------------------------
*	Name    :	Nguyen Hung Cuong
*   Class   :   TH2005
*   StuID   :   0512085
*   Mail    :   nhc.hcmuns@gmail.com
-------------------------------------------------------------------------------
	Purpose :	
******************************************************************************/
using System;
using System.Collections.Generic;
using System.Text;

namespace _512085_CaroChess
{
    /// <summary>
    /// Chess board
    /// </summary>
    public class ChessBoard
    {
        private byte _rows;
        private byte _cols;
        private byte[][] _cells;

        public byte Rows
        {
            get { return _rows; }
        }

        public byte Cols
        {
            get { return _cols; }
        }

        public byte this[byte row, byte col]
        {
            get { return _cells[row][col]; }
            set { _cells[row][col] = value; }
        }

        public ChessBoard(byte rows, byte cols)
        {
            _rows = rows;
            _cols = cols;

            // init
            _cells = new byte[_rows][];
            for (int i = 0; i < _rows; ++i )
            {
                _cells[i] = new byte[_cols];
            }
        }

        /// <summary>
        /// Reset the board
        /// </summary>
        public void Reset()
        {
            for (int i = 0; i < _rows; ++i )
            {
                for (int j = 0; j < _cols; ++j)
                {
                    _cells[i][j] = 0;
                }
            }
        }
    }
}
